﻿using System;
using ZHDJ.Data.Models.Common;
using ZHDJ.WebPage;


namespace ZHDJ.Web.Portal.InformationFreeing
{
    public partial class InformationFreeingDetail : PortalPage
    {
        private string KeyID
        {
            get
            {
                return this.Request.QueryString["ID"] ?? "";
            }
        }

        /// <summary>
        /// Page_Load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            PartyArticle article = DB.PartyArticles.Find(KeyID);

            this.lblTitle.Text = article.Title;
            this.lbOrgName.Text = ControlBusiness.GetBranchPickerText(article.BranchID);
            this.lblCreateTime.Text = Convert.ToDateTime(article.CreateTime).ToString("yyyy-MM-dd");
            if (!string.IsNullOrEmpty(article.ImageID))
            {
                this.ltContent.Text = string.Format("<div style=\"text-align:center;\"><img src=\"{0}\" style=\"width:550px;\" alt=\"\"/></div>",
                    UpFileBusiness.GetFileUrl(article.ImageID) + article.Content);
            }
            else
            {
                this.ltContent.Text = article.Content;
            }
        }
    }
}